package com.cnap.multiclouldmgmt.model.flavor;

import cn.hutool.core.collection.CollUtil;
import com.alibaba.fastjson.JSON;
import org.apache.commons.lang3.StringUtils;

import java.util.Date;
import java.util.List;

/**
 * 云规格信息
 * 
 * @author tyj
 * @date 2022/11/22
 */
public class CloudFlavorInfo{

    private String accountName;

    /**
     * 实体编号（唯一标识）
     */
    protected int id;
    /**
     * 创建时间
     */
    private Date createDate;
    /**
     * 更新时间
     */
    private Date updateDate;
    /**
     * 云类型
     */
    private String cloudType;
    /**
     * 云区域
     */
    private String regionId;
    /**
     * 可用区
     */
    private String zoneId;
    /**
     * 镜像信息json字符串
     */
    private String imageStr;
    /**
     * 实例规格信息json字符串
     */
    private String flavorStr;
    /**
     * 磁盘规格信息json字符串
     */
    private String diskTypeStr;
    // 以下非数据库字段
    private List<ImageInfo> images;
    private List<FlavorInfo> flavors;
    private List<DiskTypeInfo> diskTypes;

    public CloudFlavorInfo() {
        // 默认构造方法
    }

    /**
     * 获取cloudType
     * 
     * @return the cloudType
     */
    public String getCloudType() {
        return cloudType;
    }

    /**
     * 设置 cloudType
     * 
     * @param cloudType the cloudType to set
     */
    public void setCloudType(String cloudType) {
        this.cloudType = cloudType;
    }

    /**
     * 获取regionId
     * 
     * @return the regionId
     */
    public String getRegionId() {
        return regionId;
    }

    /**
     * 设置 regionId
     * 
     * @param regionId the regionId to set
     */
    public void setRegionId(String regionId) {
        this.regionId = regionId;
    }

    /**
     * 获取zoneId
     * 
     * @return the zoneId
     */
    public String getZoneId() {
        return zoneId;
    }

    /**
     * 设置 zoneId
     * 
     * @param zoneId the zoneId to set
     */
    public void setZoneId(String zoneId) {
        this.zoneId = zoneId;
    }

    /**
     * 获取imageStr
     * 
     * @return the imageStr
     */
    public String getImageStr() {
        return imageStr;
    }

    /**
     * 设置 imageStr
     * 
     * @param imageStr the imageStr to set
     */
    public void setImageStr(String imageStr) {
        this.imageStr = imageStr;
    }

    /**
     * 获取flavorStr
     * 
     * @return the flavorStr
     */
    public String getFlavorStr() {
        return flavorStr;
    }

    /**
     * 设置 flavorStr
     * 
     * @param flavorStr the flavorStr to set
     */
    public void setFlavorStr(String flavorStr) {
        this.flavorStr = flavorStr;
    }

    /**
     * 获取diskTypeStr
     * 
     * @return the diskTypeStr
     */
    public String getDiskTypeStr() {
        return diskTypeStr;
    }

    /**
     * 设置 diskTypeStr
     * 
     * @param diskTypeStr the diskTypeStr to set
     */
    public void setDiskTypeStr(String diskTypeStr) {
        this.diskTypeStr = diskTypeStr;
    }

    /**
     * 获取images
     * 
     * @return the images
     */
    public List<ImageInfo> getImages() {
        return images;
    }

    /**
     * 设置 images
     * 
     * @param images the images to set
     */
    public void setImages(List<ImageInfo> images) {
        this.images = images;
    }

    /**
     * 获取flavors
     * 
     * @return the flavors
     */
    public List<FlavorInfo> getFlavors() {

        if (StringUtils.isNotBlank(flavorStr)){
            flavors = JSON.parseArray(flavorStr, FlavorInfo.class);
        }

        return flavors;
    }

    /**
     * 设置 flavors
     * 
     * @param flavors the flavors to set
     */
    public void setFlavors(List<FlavorInfo> flavors) {
        this.flavors = flavors;
    }

    /**
     * 获取diskTypes
     * 
     * @return the diskTypes
     */
    public List<DiskTypeInfo> getDiskTypes() {
        return diskTypes;
    }

    /**
     * 设置 diskTypes
     * 
     * @param diskTypes the diskTypes to set
     */
    public void setDiskTypes(List<DiskTypeInfo> diskTypes) {
        this.diskTypes = diskTypes;
    }

    /**
     * get
     *
     * @return AccountName
     */
    public String getAccountName() {
        return accountName;
    }

    /**
     * set
     *
     * @param accountName accountName
     */
    public void setAccountName(String accountName) {
        this.accountName = accountName;
    }

    /**
     * get
     *
     * @return Id
     */
    public int getId() {
        return id;
    }

    /**
     * set
     *
     * @param id id
     */
    public void setId(int id) {
        this.id = id;
    }

    /**
     * get
     *
     * @return CreateDate
     */
    public Date getCreateDate() {
        return createDate;
    }

    /**
     * set
     *
     * @param createDate createDate
     */
    public void setCreateDate(Date createDate) {
        this.createDate = createDate;
    }

    /**
     * get
     *
     * @return UpdateDate
     */
    public Date getUpdateDate() {
        return updateDate;
    }

    /**
     * set
     *
     * @param updateDate updateDate
     */
    public void setUpdateDate(Date updateDate) {
        this.updateDate = updateDate;
    }
}
